# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO


if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
    raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__))

class ArsParseObject(KaitaiStruct):
    def __init__(self, _io, _parent=None, _root=None):
        self._io = _io
        self._parent = _parent
        self._root = _root if _root else self
        self._read()

    def _read(self):
        self.header = ArsParseObject.HeaderStr(self._io, self, self._root)
        self.body = ArsParseObject.ObjectListStr(self._io, self, self._root)
        self.empty = []
        i = 0
        while not self._io.is_eof():
            self.empty.append(self._io.read_u1())
            i += 1


    class HeaderStr(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.service_id = self._io.read_u2be()
            self.method_id = self._io.read_u2be()
            self.length = self._io.read_u4be()
            self.client_id = self._io.read_u2be()
            self.session_id = self._io.read_u2be()
            self.protocol_version = self._io.read_u1()
            self.interface_version = self._io.read_u1()
            self.message_type = self._io.read_u1()
            self.return_code = self._io.read_u1()


    class ObjectListStr(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.crc_h = self._io.read_u4be()
            self.crc_l = self._io.read_u4be()
            self.length = self._io.read_u4be()
            self.sqc = self._io.read_u4be()
            self.data_id = self._io.read_u4be()
            self.timestamp_nanoseconds = self._io.read_u4be()
            self.timestamp_seconds = self._io.read_u4be()
            self.timestamp_syncstatus = self._io.read_u1()
            self.eventdataqualifier = self._io.read_u4be()
            self.extendedqualifier = self._io.read_u1()
            self.objectlist_numofobjects = self._io.read_u1()
            self.objectlist_objects = [None] * (50)
            for i in range(50):
                self.objectlist_objects[i] = ArsParseObject.ObjectSrc(self._io, self, self._root)



    class ObjectSrc(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.u_statussensor = self._io.read_u2be()
            self.u_id = self._io.read_u4be()
            self.u_age = self._io.read_u2be()
            self.u_statusmeasurement = self._io.read_u1()
            self.u_statusmovement = self._io.read_u1()
            self.u_position_invalidflags = self._io.read_u2be()
            self.u_position_reference = self._io.read_u1()
            self.u_position_x = self._io.read_f4be()
            self.u_position_x_std = self._io.read_f4be()
            self.u_position_y = self._io.read_f4be()
            self.u_position_y_std = self._io.read_f4be()
            self.u_position_z = self._io.read_f4be()
            self.u_position_z_std = self._io.read_f4be()
            self.u_position_covariancexy = self._io.read_f4be()
            self.u_position_orientation = self._io.read_f4be()
            self.u_position_oientation_std = self._io.read_f4be()
            self.u_existence_invalidflags = self._io.read_u1()
            self.u_existence_probability = self._io.read_f4be()
            self.u_existence_ppv = self._io.read_f4be()
            self.u_classification_car = self._io.read_u1()
            self.u_classification_truck = self._io.read_u1()
            self.u_classification_motorcycle = self._io.read_u1()
            self.u_classification_bicycle = self._io.read_u1()
            self.u_classification_pedestrian = self._io.read_u1()
            self.u_classification_animal = self._io.read_u1()
            self.u_classification_hazard = self._io.read_u1()
            self.u_classification_unknown = self._io.read_u1()
            self.u_classification_overdrivable = self._io.read_u1()
            self.u_classification_underdrivable = self._io.read_u1()
            self.u_dynamics_absvel_invalidflags = self._io.read_u1()
            self.f_dynamics_absvel_x = self._io.read_f4be()
            self.f_dynamics_absvel_x_std = self._io.read_f4be()
            self.f_dynamics_absvel_y = self._io.read_f4be()
            self.f_dynamics_absvel_y_std = self._io.read_f4be()
            self.f_dynamics_absvel_covariancexy = self._io.read_f4be()
            self.u_dynamics_relvel_invalidflags = self._io.read_u1()
            self.f_dynamics_relvel_x = self._io.read_f4be()
            self.f_dynamics_relvel_x_std = self._io.read_f4be()
            self.f_dynamics_relvel_y = self._io.read_f4be()
            self.f_dynamics_relvel_y_std = self._io.read_f4be()
            self.f_dynamics_relvel_covariancexy = self._io.read_f4be()
            self.u_dynamics_absaccel_invalidflags = self._io.read_u1()
            self.f_dynamics_absaccel_x = self._io.read_f4be()
            self.f_dynamics_absaccel_x_std = self._io.read_f4be()
            self.f_dynamics_absaccel_y = self._io.read_f4be()
            self.f_dynamics_absaccel_y_std = self._io.read_f4be()
            self.f_dynamics_absaccel_covariancexy = self._io.read_f4be()
            self.u_dynamics_relaccel_invalidflags = self._io.read_u1()
            self.f_dynamics_relaccel_x = self._io.read_f4be()
            self.f_dynamics_relaccel_x_std = self._io.read_f4be()
            self.f_dynamics_relaccel_y = self._io.read_f4be()
            self.f_dynamics_relaccel_y_std = self._io.read_f4be()
            self.f_dynamics_relaccel_covariancexy = self._io.read_f4be()
            self.u_dynamics_orientation_invalidflags = self._io.read_u1()
            self.u_dynamics_orientation_rate_mean = self._io.read_f4be()
            self.u_dynamics_orientation_rate_std = self._io.read_f4be()
            self.u_shape_length_status = self._io.read_u4be()
            self.u_shape_length_edge_invalidflags = self._io.read_u1()
            self.u_shape_length_edge_mean = self._io.read_f4be()
            self.u_shape_length_edge_std = self._io.read_f4be()
            self.u_shape_width_status = self._io.read_f4be()
            self.u_shape_width_edge_invalidflags = self._io.read_u1()
            self.u_shape_width_edge_mean = self._io.read_f4be()
            self.u_shape_width_edge_std = self._io.read_f4be()



